# -*- coding: utf-8 -*-
A = raw_input()
B = raw_input()
all_colors = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
AD = {}
BD = {}
for e in all_colors:
    AD[e]=0
    BD[e]=0
for e in all_colors:
    if e in A:
        AD[e]+=A.count(e)
    if e in B:
        BD[e]+=B.count(e)

yes_or_no = 'Yes'

count = 0
for e in all_colors:
    if AD[e] < BD[e]:
        yes_or_no = 'No'
        count += BD[e]-AD[e]

if yes_or_no == 'Yes':
    print 'Yes '+str(len(A)-len(B))
else:
    print 'No '+str(count)